/* 封装用户相关的接口 */

import axios from '@/utils/request'
// import store from '@/store'
/**
 *
 * @param {Number} mobile 手机号
 * @param {Number} code 验证码
 * @returns
 */
export const userLogin = (mobile, code) =>
  axios({
    method: 'POST',
    url: '/v1_0/authorizations',
    // POST方式，数据写在data中
    data: {
      mobile,
      code
    }
  })

export const getUserInfo = () => {
  // const token = store.state.user.token.token
  return axios({
    url: '/v1_0/user/profile'
    // 携带请求头信息，封装到请求拦截器中啦
    /* headers: {
      Authorization: 'Bearer ' + token
    } */
  })
}
